home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 9H9OYT (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.5 KB  |  29 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.JList;
  4. import com.sun.java.swing.event.ListSelectionEvent;
  5. import com.sun.java.swing.event.ListSelectionListener;
  6. import java.io.File;
  7. import java.util.EventObject;
  8.  
  9. class BasicFileChooserUI$SelectionListener implements ListSelectionListener {
  10.    // $FF: synthetic field
  11.    BasicFileChooserUI this$0;
  12.  
  13.    public void valueChanged(ListSelectionEvent e) {
  14.       if (!e.getValueIsAdjusting()) {
  15.          JList list = (JList)((EventObject)e).getSource();
  16.          File f = (File)list.getSelectedValue();
  17.          if (f != null && (this.this$0.getFileChooser().isDirectorySelectionEnabled() || !this.this$0.getFileChooser().isTraversable(f))) {
  18.             this.this$0.getFileChooser().setSelectedFile(f);
  19.          }
  20.       }
  21.  
  22.    }
  23.  
  24.    // $FF: synthetic method
  25.    BasicFileChooserUI$SelectionListener(BasicFileChooserUI this$0) {
  26.       this.this$0 = this$0;
  27.    }
  28. }
  29.